package com.aizuda.boot.modules.common.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author sangyirong
 * @ClassName ChangeTypeEnum
 * @Version 1.0
 * @Date 2025/7/19 13:45
 */
@Getter
@AllArgsConstructor
public enum ChangeTypeEnum {

    CREATE("create", "新增"),
    UPDATE("update", "修改"),
    ;

    private final String code;
    private final String desc;


    public static ChangeTypeEnum getByDesc(String desc) {
        for (ChangeTypeEnum value : ChangeTypeEnum.values()) {
            if (value.getDesc().equals(desc)) {
                return value;
            }
        }
        return null;
    }
}
